import axios from '../config/axiosConfig';
/**
 * 获取商品配置表 config
 */
export const getGoodsConfigApi = (data?:any) => {
  return axios.get('/goods/config',{params: data});
}
// 获取商品列表
export const getGoodsListApi = (data: any) => {
  return axios.get('/goods/list', { params: data });
}
// 添加商品
export const addGoodsApi = (data: any) => {
  return axios.post('/goods/add', data);
}
// 删除商品
export const deleteGoodsApi = (id: any) : Promise<any> => {
	return axios.delete(`/goods/delete/${id}`);
}
// 编辑商品
export const editGoodsApi = (data: any,id:any) => {
  return axios.put(`/goods/edit/${id}`, data);
}
// 获取商品详情
export const getGoodsDetailApi = (id: any) => {
  return axios.get(`/goods/detail/${id}`);
}

// 获取商品分类列表
export const getGoodsCateListApi = (data:any) => {
  return axios.get('/goods/category/list',{params:data});
}
// 获取商品分类详情  没有开发
export const getGoodsCateDetailApi = (id: any) => {
  return axios.get(`/goods/category/detail/${id}`);
}
// 添加商品分类
export const addGoodsCateApi = (data: any) => {
  return axios.post('/goods/category/add', data);
}
// 编辑商品分类
export const editGoodsCateApi = (data: any,id:any) : Promise<any> => {
  return axios.put(`/goods/category/edit/${id}`, data);
}
// 删除商品分类
export const deleteGoodsCateApi = (id: any) : Promise<any> => {
	return axios.delete(`/goods/category/delete/${id}`);
}